package cn.xuewei.mapper;

import cn.xuewei.pojo.entity.Content;
import cn.xuewei.pojo.vo.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContentMapper {

    int insert(Content content);

    List<ContentManagementVO> selectPersonalContent(Integer type, Long userid);

    ContentEditVO selectByIdForEdit(Long id);

    void update(Content content);

    void deleteById(Long id);

    List<ContentIndexVO> indexHot(Long subId);
    List<ContentIndexVO> indexNew(Long subId);

    ContentDetailVO detailById(Long id);

    void updateCommentCountById(Long contentId);

    void updateViewCountById(Long id);

    void updateLikeCountById(Long id);

    List<ContentAdminVO> selectByTypeForAdmin(Integer type);

    List<CourseContentVO> selectByVideoCategoryId(int categoryId,int paid);


    /**搜索Article，Video，User*/
    List<ContentSearchVO> selectByCategoryIdAndKdArticle(Long categoryId, String kd);
    List<ContentSearchVO> selectByCategoryIdAndKdVideo(Long categoryId, String kd);
    List<ContentSearchVO> selectByCategoryIdAndKdUser(Long categoryId, String kd);
    List<ContentSearchVO> selectByUserId(Long userId);
    List<ContentSearchVO> selectAllByUserId(Long userId);


    List<ContentSimpleVO> selectHot();

    ContentDataVO getCountByUser(Long id);

    List<ContentSimpleVO> selectOthersByUserId(Long userId);

    List<CourseContentVO> selectByCourseCategoryId(int categoryId,int paid);

    void incrementLikeCount(Long contentId);

    void decrementLikeCount(Long contentId);

    List<CourseContentVO> selectByCourseListId(int paid);

    List<UserInfoVO> listByUser();
}
